<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=750,user-scalable=no" />
        <!--,user-scalable=no-->
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-title" content="">
        <meta name="format-detection" content="telephone=no">
		<if condition='MODULE_NAME eq "Member"'> 
			<if condition="ACTION_NAME eq 'address' || ACTION_NAME eq 'addaddress' || ACTION_NAME eq 'editaddress'">
			<title>收货地址</title>
			</if>
		</if>

		<if condition='MODULE_NAME eq "Welfare"'> 
			<if condition="ACTION_NAME eq 'index' || ACTION_NAME eq 'detail'">
				<title>肌肤管家福利社</title>
			</if>
		</if>
		<if condition='MODULE_NAME eq "Cart"'> 
			<if condition="ACTION_NAME eq 'cart' || ACTION_NAME eq 'pay'">
				<title>购物车</title>
			</if>
                        <if condition="ACTION_NAME eq 'onlinepay'">
				<title>支付</title>
			</if>
		</if>
        <link rel="stylesheet" href="__PUBLIC__/css/style.css">
        <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">

        <script src="__PUBLIC__/js/jquery-1.11.3.min.js"></script>
        <script src="__PUBLIC__/js/login.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/ios.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/addons.js"></script>
		

        <script type="text/javascript">
			openApp();
			var baseurl = "{WEB_URL}";
			
//          购物车判断
			var cartNum = {:intval(session('cartcount'))};
            $(function () {
                var countSurplus = [28,29];
                var countTime =["01:32:09","00:32:08"];
                for(var i=0;i<countTime.length;i++){
                    $("#countTime" + i).html(countTime[i]);
                    $("#countSurplus" + i).html(countSurplus[i]);
                }

                $(".btn-sRight").click(function(){
                    confirm("ok");
                });
                $(".btn-back").click(function(){
//                    var m = document.getElementById('module').value;
//                    var a = document.getElementById('action_name').value;
                    if(m == 'Welfare' && a == "index"){
                        document.getElementById('btn-back').style.display = none;
                    }else{
                        javascript:history.back(-1);return false;
						document.location.reload();
                    }
                    
                });
            });
			
			function getBrowser() {
				var u = navigator.userAgent, app = navigator.appVersion;
				var res = [];
				res.trident = u.indexOf('Trident') > -1;
				res.presto = u.indexOf('Presto') > -1; //opera内核
				res.webKit = u.indexOf('AppleWebKit') > -1; //苹果、谷歌内核 
				res.gecko = u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1; //火狐内核
				res.mobile = !!u.match(/AppleWebKit.*Mobile.*/); //是否为移动终端
				res.ios = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
				res.android = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器 
				res.iPhone = u.indexOf('iPhone') > -1 ; //是否为iPhone或者QQHD浏览器
				res.iPad = u.indexOf('iPad') > -1; //是否iPad 
				res.webApp = u.indexOf('Safari') == -1; //是否web应该程序，没有头部与底部 
				return res;
			}
			function openApp(){
				var fresh = "{$_GET['isrefresh']}";
				var browser = getBrowser();
				if(browser.mobile || browser.ios || browser.android || browser.iPhone || browser.iPad){
					if(!fresh){
						var isweixin = navigator.userAgent.toLowerCase();
						if(isweixin.match(/MicroMessenger/i)=="micromessenger") {
//							window.setTimeout(function () {
//									window.location.href = 'http://mp.weixin.qq.com/mp/redirect?url=https%3A%2F%2Fitunes.apple.com%2FWebObjects%2FMZStore.woa%2Fwa%2FviewSoftware%3Fid%3D881707446%26mt%3D8';
//							}, 1000);
						}else {
						   var ua = navigator.userAgent;
						   if(ua.match(/iPhone|iPod|iPad/i) != null){
								//iphone代码
								var url = 'SkinRunScheme://';
						   }else{
								//安卓代码
								var url = 'myappskinrun://skinrun/skinrunopen';
						   }
						   window.setTimeout(function () {
									window.location.href = url + '&isrefresh=1' // 附加一个特殊参数，用来标识这次刷新不要再调用myapp:// 了
							}, 1000);
						}
					}
				}
			}

			
        </script>
    </head>

    <body>
	<if condition="ACTION_NAME eq 'cart' or ACTION_NAME eq 'onlinepay'">
		<div class="myMask"></div>
		 <div class="emptyCart hide">
            <div class="emptyBg"></div>
            <div class="btn-getPro">
                <a href="{:U('Welfare/Display/index')}">去逛逛</a>
            </div>
        </div>
	</if>
        <div class="layout">
			
			<block name='content'></block>
		</div>
        
        <div class="signIn hide">
            <div class="cancelSIn"></div>
            <p>手机登录</p>
                <ul>
                    <li>
                        <input type="text" class="text" placeholder="请输入手机号码" name="mobile" id="mobile" value="" />
                        <input type="button" class="button" name="" id="getCodeBtn" value="获取验证码"/>
                    </li>
                    <li>
                        <input class="text" type="text" placeholder="请输入短信验证码" name="verifycode" id="verifycode" value=""  />
                    </li>
                </ul>
                <button class="submit" onclick="go_login()"/>登录</button>
        </div>
		<div class="myMask"></div>
		<script>

                        function go_cart(){
                            var uid = parseInt("{:session('uid')}");
							if(cartNum){
								if(uid){
									var url = "{:U('Cart/Display/cart')}";
									window.location.href = url;
								}else{
									show_login("/Cart/Display/cart");
								}
							}
                            
                        }
                        
                        document.getElementById("getCodeBtn").onclick=function(){
                            var mb = document.getElementById('mobile').value;
                            if(mb != "" && mb != null){
                                time(this);
                            }else{
                                alert("请输入手机号");
                            }
                            
                        }
                        
                        //结算弹出登陆层
                        //$(".btn-buyNow").click(function(){
                            //$(".signIn").removeClass("hide").addClass("moveD");
                            //$(".myMask").css("display","block");
                        //});
                        $(".cancelSIn").click(function(){
                            $(".signIn").addClass("hide");
                            $(".myMask").css("display","none");
                        });
				
		</script>
    </body>
</html>